package com.xjh.basestudy.designmode.structureMode.structureMode5_FlyWeight.p2_flyweight;

/**
 * @author XuJianHua
 * @date 2022-09-26 11:43:59
 * @description 房屋类

 */
public class House implements Drawable {

    private String image;//房屋图片材质

    public House() {
        this.image = "房屋";
        System.out.print("从磁盘加载[" + image + "]图片，耗时半秒……");
    }

    @Override
    public void draw(int x, int y) {
        System.out.print("将图层切换到顶层……");//房屋盖在地板上，所以切换到顶层图层
        System.out.println("在位置[" + x + ":" + y + "]上绘制图片：[" + image + "]");
    }

}